<%@ page pageEncoding="UTF-8"%>
<%@ include file="/common/token.jsp"%>
<%
    Integer uid = token.getUid();
    List<Map> visits = QBuilder.db("basedb").select("new map(v.id as visit_id, u.name as patient_name, v.isconfirmed as confirm, v.surveyId as survey_id, v.patientUid as patient_uid, s.title as title, u.avatar as avatar)").from("Visit as v, Survey as s, User as u").where(new Where("v.hospital=", hospital).and("v.status = ", STATUS_ENABLE).and("s.hospital=", hospital).and("s.status = ", STATUS_ENABLE).and("v.category=2").and("s.category=2").and("v.doctorUid=", uid).and("s.id = v.surveyId").and("v.patientUid=u.id")).order("v.cTime", QBuilder.desc).query().getResultObj();
    if (isEmpty(visits)) {
        msg = new Message(30041, "暂无随访计划");
    }
    msg.put("data", visits);
    Tools.encryptPrint(out, msg);
%>
